#include "fetionCom.h"
#include "regFetion.h"
/* Implementation file */
NS_IMPL_ISUPPORTS1(fetionCom, IFetionCom)

fetionCom::fetionCom()
{
  /* member initializers and constructor code */
}

fetionCom::~fetionCom()
{
  /* destructor code */
}

/* long Add (in long a, in long b); */
NS_IMETHODIMP fetionCom::Add(PRInt32 a, PRInt32 b, PRInt32 *rtn)
{
    *rtn = a + b;
    return NS_OK;
}

/* long CloseSocket (in long c); */
NS_IMETHODIMP fetionCom::CreateSocket(PRInt32 *rtn)
{
	*rtn= createSocket();
    return NS_OK;
}

/* void login (in string FetionNo, in string FetionPswd); */
NS_IMETHODIMP fetionCom::Login(const char *FetionNo, const char *FetionPswd , PRInt32 *rtn )
{
    *rtn = registeration((char *)FetionNo ,(char *) FetionPswd );
    return NS_OK;
}

/* long SendAMsg (in long c, in string from, in string to, in string msg); */
NS_IMETHODIMP fetionCom::SendAMsg(PRInt32 c, const char *from, const char *to, const char *msg, PRInt32 *rtn)
{
	*rtn = sendAMsg((int)c, (char *)from, (char *)to, (char *)msg );
    return NS_OK;
}
NS_IMETHODIMP fetionCom::GetMsg( PRInt32 c , char **rtn)
{
	*rtn = getMsg(c);
    return NS_OK;
}
/* long CloseSocket (in long c); */
NS_IMETHODIMP fetionCom::CloseSocket(PRInt32 c, PRInt32 *rtn)
{
	*rtn= closeSocket(c);
    return NS_OK;
}
NS_IMETHODIMP fetionCom::GetUserInfo(PRInt32 c , const char *FetionNo, char **info)
{
		*info = getUserInfo((int)c ,(char *)FetionNo);
	    return NS_OK;
}
NS_IMETHODIMP fetionCom::TestProxyThread(PRInt32 *rtn)
{
	*rtn= 0;
    return NS_OK;
}


